<?php
/* 
	[BuyPg] (C) 2010-2011 Buypg
	$Id: UserAction.class.php 2011-12-27 10:57:43 wufujun $
 */
if (!defined('THINK_PATH')){
	exit('Access Denied');
}

class UserAction extends BpAction{
	function _filter(&$map){
		$map['user_nickname'] = array('like',"%".$_POST['user_nickname']."%");
	}
	
	//重置密码
	public function resetPwd()
	{
		$id  =  $_POST['id'];
		$password = $_POST['password'];
		if(''== trim($password)) {
			$this->error('密码不能为空！');
		}
		$User = M('User');
		$User->user_password	=	sha1($password);
		$User->user_id			=	$id;
		$result	=	$User->save();
		if(false !== $result) {
			$this->success("密码修改为$password");
		}else {
			$this->error('重置密码失败！');
		}
	}
}
?>
